home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / xampp-win32-1.6.5-installer.exe / htdocs / xampp / status.php < prev    next >
Encoding:
PHP Script  |  2007-12-20  |  5.3 KB  |  173 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.     "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4.     <head>
  5.         <meta name="author" content="Kai Oswald Seidler, Kay Vogelgesang, Carsten Wiedmann">
  6.         <link href="xampp.css" rel="stylesheet" type="text/css">
  7.         <title></title>
  8.     </head>
  9.  
  10.     <body>
  11.         <?php include "lang/".file_get_contents("lang.tmp").".php"; ?>
  12.          <p>
  13.  
  14.         <h1><?php echo $TEXT['status-head']; ?></h1>
  15.  
  16.         <?php echo $TEXT['status-text1']; ?><p>
  17.  
  18.         <?php
  19.             $curdir = getcwd();
  20.          list($partwampp, $directorwampp) = spliti ('\\\htdocs\\\xampp', $curdir);
  21.             $i = 0;
  22.             $up = "";
  23.             
  24.             if ($_SERVER['SERVER_PORT'] == 443) {
  25.                 $prot = "https";
  26.             } else {
  27.                 $prot = "http";
  28.             }
  29.  
  30.             if (isset($_SERVER['PHP_AUTH_USER'])) {
  31.                 $up = "$_SERVER[PHP_AUTH_USER]:$_SERVER[PHP_AUTH_PW]@";
  32.             }
  33.             if ('localhost' == strtolower($_SERVER['SERVER_NAME'])) { // Fix by Wiedmann
  34.                 $server = '127.0.0.1';
  35.             } else {
  36.                 $server = $_SERVER['SERVER_NAME'];
  37.             }
  38.             $b = "$prot://$up".$server;
  39.             if ($_SERVER['SERVER_PORT'] != 80) {
  40.                 $b = "$prot://$up".$server.":".$_SERVER['SERVER_PORT']; // Fix by Wiedmann
  41.             }
  42.  
  43.             function line($text, $status, $link = "") {
  44.                 global $i, $TEXT;
  45.  
  46.                 if ($i > 0) {
  47.                     echo "<tr valign='bottom'>";
  48.                     echo "<td bgcolor='#ffffff' height='1' style='background-image:url(img/strichel.gif)' colspan='5'></td>";
  49.                     echo "</tr>";
  50.                 }
  51.                 echo "<tr bgcolor='#ffffff'>";
  52.                 echo "<td bgcolor='#ffffff'><img src='img/blank.gif' alt='' width='1' height='20'></td>";
  53.                 echo "<td class='tabval'>";
  54.                 echo "$text";
  55.                 echo "</td>";
  56.                 if (trim($status) == "OK") {
  57.                     echo "<td><span class='green'> ".$TEXT['status-ok']." </span></td>";
  58.                     echo "<td></td>";
  59.                     $i++;
  60.                 } else {
  61.                     echo "<td><span class='red'> ".$TEXT['status-nok']." </span></td>";
  62.                     if ($link == "") {
  63.                         echo "<td></td>";
  64.                     } else {
  65.                         echo "<td><a target='faq' href='$link'><span style='font-size: 10pt'>".$TEXT['status-lookfaq']."</span></a></td>";
  66.                     }
  67.                 }
  68.                 echo "<td bgcolor='#ffffff'></td>";
  69.                 echo "</tr>";
  70.                 $i++;
  71.             }
  72.  
  73.             $a = @file("$b/xampp/php.php");
  74.             $php = $a[0];
  75.             $a = @file("$b/xampp/mysql.php");
  76.             $mysql = $a[0];
  77.             $a = @file("$b/cgi-bin/cgi.cgi");
  78.             $cgi = $a[0];
  79.             $a = @file("$b/xampp/ssi.shtml");
  80.             $ssi = $a[0];
  81.  
  82.             $host = "127.0.0.1";
  83.             $timeout= 1;
  84.  
  85.             if (($handle = @fsockopen($host, 443, $errno, $errstr, $timeout)) == false) {
  86.                 $ssl="NOK";
  87.             } else {
  88.                 $ssl="OK";
  89.             }
  90.             @fclose($handle);
  91.  
  92.             echo "<table border='0' cellpadding='0' cellspacing='0'>";
  93.             echo "<tr valign='top'>";
  94.             echo "<td bgcolor='#fb7922' valign='top'><img src='img/blank.gif' alt='' width='10' height='0'></td>";
  95.             echo "<td bgcolor='#fb7922' class='tabhead'><img src='img/blank.gif' alt='' width='250' height='6'><br>".$TEXT['status-tab1']."</td>";
  96.             echo "<td bgcolor='#fb7922' class='tabhead'><img src='img/blank.gif' alt='' width='100' height='6'><br>".$TEXT['status-tab2']."</td>";
  97.             echo "<td bgcolor='#fb7922' class='tabhead'><img src='img/blank.gif' alt='' width='100' height='6'><br>".$TEXT['status-tab3']."</td>";
  98.             echo "<td bgcolor='#fb7922' valign='top'><br><img src='img/blank.gif' alt='' width='1' height='10'></td>";
  99.             echo "</tr>";
  100.             line($TEXT['status-mysql'], $mysql);
  101.             line($TEXT['status-php'], $php);
  102.             line($TEXT['status-ssl'], $ssl);
  103.             line($TEXT['status-cgi'], $cgi);
  104.             line($TEXT['status-ssi'], $ssi);
  105.         
  106.  
  107.             if ((file_exists("$partwampp\htdocs\python\\xa.py")) && (file_exists("$partwampp\apache\conf\python.conf"))) {
  108.                 $a = @file("$b/python/xa.py");
  109.                 $python = $a[0];
  110.                 line($TEXT['status-python'], $python);
  111.             }
  112.  
  113.             if ((file_exists("$partwampp\htdocs\modperl\perl.pl")) && (file_exists("$partwampp\apache\conf\extra\perl.conf"))) {
  114.                 $a = @file("$b/modperl/perl.pl");
  115.                 $perl = $a[0];
  116.                 line($TEXT['status-perl'], $perl);
  117.             }
  118.  
  119.             if (file_exists("$partwampp\MercuryMail\MERCURY.INI")) {
  120.                 if (($handle = @fsockopen($host, 25, $errno, $errstr, $timeout)) == false) {
  121.                     $smtp = "NOK";
  122.                 } else {
  123.                     $smtp = "OK";
  124.                 }
  125.                 @fclose($handle);
  126.                 line($TEXT['status-smtp'], $smtp);
  127.             }
  128.  
  129.             if (file_exists("$partwampp\FileZillaFTP\FzGSS.dll")) {
  130.                 if (($handle = @fsockopen($host, 21, $errno, $errstr, $timeout)) == false) {
  131.                     $ftp = "NOK";
  132.                 } else {
  133.                     $ftp = "OK";
  134.                 }
  135.                 @fclose($handle);
  136.                 line($TEXT['status-ftp'], $ftp);
  137.             }
  138.  
  139.             if (file_exists("$partwampp\\tomcat\conf\\server.xml")) {
  140.                 if (($handle = @fsockopen($host, 8080, $errno, $errstr, $timeout)) == false) {
  141.                     $tomcat = "NOK";
  142.                 } else {
  143.                     $tomcat = "OK";
  144.                 }
  145.                 @fclose($handle);
  146.                 line($TEXT['status-tomcat'], $tomcat);
  147.             }
  148.  
  149.             if (file_exists("$partwampp\PosadisDNS\posadis.exe")) {
  150.                 if (($handle = @fsockopen($host, 53, $errno, $errstr, $timeout)) == false) {
  151.                     $named = "NOK";
  152.                 } else {
  153.                     $named = "OK";
  154.                 }
  155.                 @fclose($handle);
  156.                 line($TEXT['status-named'], $named);
  157.             }
  158.  
  159.             echo "<tr valign='bottom'>";
  160.             echo "<td bgcolor='#fb7922'></td>";
  161.             echo "<td bgcolor='#fb7922' colspan='3'><img src='img/blank.gif' alt='' width='1' height='8'></td>";
  162.             echo "<td bgcolor='#fb7922'></td>";
  163.             echo "</tr>";
  164.             echo "</table>";
  165.  
  166.             echo "<p>";
  167.         ?>
  168.  
  169.         <?php echo $TEXT['status-text2']; ?><p>
  170.  
  171.     </body>
  172. </html>
  173.